package study.springcloud.config.nacos.support.bean;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.io.Serializable;

/**
 * （★）@ConfigurationProperties
 * （1）使用 @ConfigurationProperties 直接修饰类即可实现 nacos 动态刷新
 * （2）该类对象为 spring 增强对象：Props_01$$EnhancerBySpringCGLIB$$313921c0
 */
@Slf4j
@Data
@Configuration
@ConfigurationProperties(prefix = "bean1")
public class Bean1 implements Serializable {

    private String name;
    private int age;

    public Bean1() {
        log.info(">>>>>> 实例化 Bean1");
    }
}
